<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="jquery-3.1.0.min.js"></script>
</head>
<body>
    <button id="anniu">按钮</button>
    <div style="width:300px;height:300px;background: blue ">
        <ul>
            <li>A</li>
            <li>B</li>
            <li>C</li>
        </ul>
    </div>
<script>
    $(document).ready(function(){
        /*$("body").bind("click",clickBody);
    });
    function clickBody(){
        console.log("hello");*/

        $("body").bind("click",clickBody);
        $("div").bind("click",clickDiv);
    });
    function clickBody(event){
        console.log(event);//加上event事件的话console里会显示很多数据，其中currentTarget（给body加的监听事件）指向body，Target（点击的）指向div

    }
    function clickDiv(event){
        console.log(event);
        event.stopPropagation() //阻止父及事件冒泡
        /*event.stopImmediatePropagation()//阻止所有事件冒泡*/
    }
</script>
</body>
</html>